package com.mk.cloud.common.enums;

import org.osgl.util.S;import com.mk.cloud.common.util.S2;

/**
 * Created by cc on 2016/11/19 0019.
 */

@SuppressWarnings("unused")
public enum GlobalValues {
    //region cookie keys
    COOKIE_KEYUSER("_ujhy_c", "用户COOKIEkey"),
    COOKIE_KEYPICCODE("_up_oi98", "图形验证码"),
    //endregion

    //region 基础配置
    MESS_PARAM_DAYU_CODE("sms_code", "大于短信id，参数名"),
    EVENT_SEND_MSG("message-send", "消息发送事件名称"),
    DEFAULT_PASSWORD("eme9090", "默认密码"),
    CHARSET_UTF8("UTF-8", "默认编码"),
    CHARSET_GBK("GBK", "外部请求编码"),
    COMMON_1("1", "正常"),
    COMMON_0("0", "无效"),
    HTTP_OK_CODE("0", "请求正常状态码"),
    HTTP_DEFAULT_ERROR_CODE("2500", "请求错误默认状态码"),
    SMS_CODE("sms-code", "短信验证码缓存key"),
    LOGIN_URL("/backend/login","登录页面地址"),
    //endregion

    FLAG_NO("0","否"),
    FLAG_YES("1","是"),

    FLAG_0("0","否"),
    FLAG_1("1","是"),

    //region 设备终端类型
    DEVICE_1("1", "APP"),
    DEVICE_2("2", "PC-WEB"),
    //endregion

    //region 用户类型
    USERTYPE_0("0", "平台员工"),
    USERTYPE_1("1", "企业账号"),
    USERTYPE_2("2", "仓库账号"),
    //endregion

    //region 用户状态
    USERSTATE_1("1", "正常"),
    USERSTATE_0("0", "失效"),
    //endregion

    //region 消息状态
    MSSTATE_0("0", "未读"),
    MSSTATE_1("1", "已读"),
    MSSTATE_2("2", "删除"),
    //endregion

    //region 消息类型
    MSTYPE_0("0", "系统消息"),
//    MSTYPE_1("1", "交易消息"),
    //endregion

    //region 常用常量
    DEFAULT_JSONARRAY("[]", "空的json数组"),
    DEFAULT_JSONOBJECT("{}", "空的json对象"),
    //endregion
/************* 上面的不要删除 *****************/

    //region 商品类型
    PD_TYPE_0("0","新店体验"),
    PD_TYPE_1("1","特购权商品"),
    PD_TYPE_2("2","体验子商品"),
    PD_TYPE_3("3","爆品体验商品"),
    //endregion

    //region 商品类型
    PD_STATUS_0("0","草稿"),
    PD_STATUS_1("1","下架"),
    PD_STATUS_2("2","上架"),
    //endregion

    //region 文章类型
    ARTTYPE_0("0","合作案例"),
    ARTTYPE_1("1","产品效果"),
    ARTTYPE_2("2","品牌介绍"),
    ARTTYPE_3("3","奖励说明"),
    ARTTYPE_4("4","特购权介绍"),
    ARTTYPE_5("5","在线培训(音频)"),
    ARTTYPE_6("6","爆品营销"),
    //endregion

    //文章状态 0=草稿 1=发布 2=已删除
    ARTSTATE_0("0","草稿"),
    ARTSTATE_1("1","发布"),
    ARTSTATE_2("2","已删除"),

    //文章状态 0=草稿 1=发布 2=已删除
    PA_STATUS_0("0","草稿"),
    PA_STATUS_1("1","下架"),
    PA_STATUS_2("2","上架"),

    //方案发布状态 0=草稿 1=发布 2=已删除 publishstatus
    PUBLISH_STATUS_0("0","草稿"),
    PUBLISH_STATUS_1("1","发布"),
    PUBLISH_STATUS_2("2","已删除"),

    //订单状态
    ORDER_STATE_0("0","全部"),
    ORDER_STATE_1("1","待付款"),
    ORDER_STATE_2("2","已付款"),
    ORDER_STATE_3("3","线下已处理"),
    ORDER_STATE_4("4","已关闭"),

    //用户审核状态
    PU_STATE_0("0",""),
    PU_STATE_1("1","待审核"),
    PU_STATE_2("2","驳回"),
    PU_STATE_3("3","通过"),

    PLEVEL_0("0","自由人"),//自己进入的公众号,不是通过分享链接进来的
    PLEVEL_1("1","一级合伙人"),
    PLEVEL_2("2","二级推广人"),
    PLEVEL_3("3","三级推广人"),
    PLEVEL_4("4","三级及以上级合伙人"),

    //region 钱包展示流水,进出账类型
    FLOW_TYPE_0("0","收入"),
    FLOW_TYPE_1("1","支出"),
    //endregion

    SOURCETYPE_0("0","提现"),
    SOURCETYPE_1("1","转介绍新店体验现金奖励"),
    SOURCETYPE_2("2","团队裂变现金奖励"),
    SOURCETYPE_3("3","提现审核拒绝"),
    SOURCETYPE_4("4","转介绍爆品体验现金奖励"),

    MENU_SHOW_PLACE_0("0","首页"),
    MENU_SHOW_PLACE_1("1","体验"),

    ART_SHOW_TYPE_0("0","文章详情"),
    ART_SHOW_TYPE_1("1","小图列表"),
    ART_SHOW_TYPE_2("2","仅大图列表"),
    ART_SHOW_TYPE_3("3","大图商品名称列表"),
    ART_SHOW_TYPE_4("4","大图商品名称列表"),

/**状态(0-待审核1-审核通过2-审核驳回3-提现成功4-提现失败5-提现中)
 *@param  awfstate
 */
    //提现状态 申请状态
    AWF_STATE_0("0","待审核"),
    AWF_STATE_1("1","审核通过"),
    AWF_STATE_2("2","审核驳回"),
    AWF_STATE_3("3","提现成功"),
    AWF_STATE_4("4","提现失败"),
    AWF_STATE_5("5","提现中"),

    //提现流水状态
    FLOW_STATE_0("0","成功"),
    FLOW_STATE_1("1","失败"),
    FLOW_STATE_2("2","提现中"),
    //支付类型
    PAY_TYPE_0("0","微信"),
    PAY_TYPE_1("1","银联"),
    PAY_TYPE_2("2","支付宝"),
    PAY_TYPE_3("3","通联"),

    ;





    private final String value;
    private final String desc;

    GlobalValues(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public boolean eq(String v) {
        return S.eq(v, value);
    }

    public String value() {
        return this.value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    public String desc() {
        return this.desc;
    }

    public static GlobalValues getlobalValues(String value){
        for (int i=0;i<GlobalValues.values().length;i++){
            if(S.eq(GlobalValues.values()[i].value(),value)){
                return GlobalValues.values()[i];
            }
        }
        return null;
    }
}
